import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:zootix/screens/rank/zt_rank.controller.dart';
import 'package:zootix/store/zt_ticket.store.dart';
import 'package:zootix/util/zt_common.util.dart';
import 'package:zootix/util/zt_screen_adaper_util.dart';

class ZtTicketNumberPopup extends StatelessWidget {
  final _controller = Get.find<ZtRankController>();
  ZtTicketNumberPopup({super.key}) {}

  @override
  Widget build(BuildContext context) {
    return Container(
      height: ZtScreenAdaper.height(400),
      width: ZtScreenAdaper.width(500),
      padding: EdgeInsets.symmetric(vertical: ZtScreenAdaper.height(10)),
      decoration: BoxDecoration(
          border: Border.all(
              color: const Color(0xFFF3AA3B), width: ZtScreenAdaper.sp(5)),
          borderRadius: BorderRadius.circular(30),
          image: const DecorationImage(
              fit: BoxFit.cover,
              image: AssetImage('assets/images/ticket_copy_popup_bg.png'))),
      child: Column(
          mainAxisSize: MainAxisSize.max,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Center(
                  child: Text(
                    'Ticket Purchase',
                    style: TextStyle(
                        fontStyle: FontStyle.italic,
                        fontSize: ZtScreenAdaper.sp(24),
                        fontWeight: FontWeight.bold),
                  ),
                ),
              ],
            ),
            SizedBox(
              height: ZtScreenAdaper.height(50),
            ),
            Padding(
                padding:
                    EdgeInsets.symmetric(horizontal: ZtScreenAdaper.width(30)),
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    Obx(() => Text(
                          '${ZtTicketStore.to.ticketNumber}',
                          textAlign: TextAlign.center,
                          style: TextStyle(
                              fontWeight: FontWeight.bold,
                              fontSize: ZtScreenAdaper.sp(22),
                              color: const Color(0xFFF3AA3B)),
                        ))
                  ],
                )),
            SizedBox(
              height: ZtScreenAdaper.height(10),
            ),
            Padding(
              padding:
                  EdgeInsets.symmetric(horizontal: ZtScreenAdaper.width(10)),
              child: Text(
                'Redeem at SAFARI Safari Park, Phuket Island',
                style: TextStyle(
                    color: const Color(0xFFCCCCCC),
                    fontSize: ZtScreenAdaper.sp(15)),
              ),
            ),
            const Spacer(),
            ElevatedButton(
                style: ElevatedButton.styleFrom(
                    shape: RoundedRectangleBorder(
                        side: const BorderSide(color: Colors.white, width: 1),
                        borderRadius:
                            BorderRadius.circular(ZtScreenAdaper.sp(30))),
                    padding: EdgeInsets.symmetric(
                        horizontal: ZtScreenAdaper.height(60),
                        vertical: ZtScreenAdaper.height(10)),
                    backgroundColor: const Color(0xFFFFCA41)),
                onPressed: () {
                  ZtCommonUtil.doCopy(ZtTicketStore.to.ticketNumber.value);
                },
                child: Text(
                  'Copy',
                  style: TextStyle(fontSize: ZtScreenAdaper.sp(18)),
                ))
          ]),
    );
  }
}
